home *** CD-ROM | disk | FTP | other *** search
/ Windows Expert / Windows Expert.iso / windownt / cshx86.zip / STARTUP.CSH < prev   
Text File  |  1993-04-14  |  4KB  |  103 lines

  1. #  Startup.csh Release 2.1 for Windows NT
  2.  
  3. #  This is a sample startup.csh file.  Hamilton C shell looks for this
  4. #  file in your home directory every time you start a new copy whether
  5. #  from the Program Manager or from the command line.  You should edit
  6. #  this file to customize it to your needs, in particular to add any
  7. #  alias definitions you always want available each time you start
  8. #  the shell.  Blank lines are ignored; text following a "#" on a given
  9. #  line is considered a comment.
  10.  
  11. #  Paste the current directory onto the front of the search path if it's
  12. #  not already there.  (If you're satisfied you've already set the path
  13. #  variable to start with "." through regedit, you can delete this step.)
  14. if (path[0] != ".") set path = . $path
  15.  
  16. #  Useful constant.
  17. @     pi       = 3.1415926535897932384626433
  18.  
  19. #  Aliases to allow these functions to be used under cmd.exe albeit
  20. #  under different names.  (Date and vol conflict with cmd.exe builtins.)
  21. alias date     dt
  22. alias vol      vl
  23.  
  24. #  NT doesn't allow any directories to be placed ahead of the system defaults
  25. #  in a user's search path thru the Control Panel (where naturally, you'd want
  26. #  to set it), so to override the standard more and label and the NT SDK rm
  27. #  commands (without actually deleting them), we've given the Hamilton versions
  28. #  different names and used the alias facility instead.
  29. alias more     hmore
  30. alias label    hlabel
  31. alias rm       hrm
  32.  
  33. #  Aliases to simulate cmd.exe builtins.
  34. alias dir      cmd /c dir
  35. alias md       mkdir
  36. alias pause    (echo -n Press any key when ready ...; @ getchar; echo)
  37. alias rd       rmdir
  38. alias start    cmd /c start
  39. alias type     cat
  40.  
  41. #  Aliases and procedures for intercepting copy, xcopy and rename commands so
  42. #  that wildcarding won't be done before they're called.
  43. proc safecopy(files)
  44.    cmd /c copy $files; @ nowild = s; unlocal s
  45. end
  46. alias copy     (local s; @ s = nowild; @ nowild = 1; safecopy)
  47. proc safexcopy(files)
  48.    xcopy.exe $files; @ nowild = s; unlocal s
  49. end
  50. alias xcopy    (local s; @ s = nowild; @ nowild = 1; safexcopy)
  51. proc saferename(files)
  52.    cmd /c rename $files; @ nowild = s; unlocal s
  53. end
  54. alias rename   (local s; @ s = nowild; @ nowild = 1; saferename)
  55. alias ren      rename
  56.  
  57. #  Intercept the del command so "del *.*" still gives the "Are you sure?"
  58. #  message.  (Alternately, you may prefer to simply alias it to rm.exe.)
  59. proc safedel(files)
  60.    cmd /c del $files; @ nowild = s; unlocal s
  61. end
  62. alias del      (local s; @ s = nowild; @ nowild = 1; safedel)
  63. alias erase    del
  64.  
  65. #  Aliases to implement obsolete Unix C shell reserved words.  (You may
  66. #  not want these unless you have old habits.)
  67. alias breaksw  break
  68. alias endif    end
  69. alias endsw    end
  70.  
  71. #  Typical locally-defined aliases.  (Edit this section to define your own.)
  72.  
  73. alias di       diff -b!    #  "Diff interactive":  Merged diff using color to
  74.                            #     show changes.  Ignore white space differences.
  75. alias duc      du -c       #  Disk usage for the current disk only.
  76. alias beep     eval echo -n ^^a  #  Beep! (eval is used with an extra ^ so
  77.                                  #     just listing aliases won't beep at you.)
  78. alias mi       more -i     #  "More interactive":  Clear screen first for
  79.                            #     speed.  Don't exit if less than a screenful.
  80. alias f        fgrep       #  Faster name for fgrep.
  81. alias fn       fgrep -n    #  Fgrep and print line numbers.
  82. alias g        grep        #  Faster name for grep.
  83. alias h        history
  84. alias cdd      cd +c       #  Change directory AND disk.
  85. alias home     cdd ~       #  Change to the home directory and disk.
  86. alias q        exit
  87. alias ll       ls -L       #  Long listing of the directory.
  88. alias ld       ls -a +D -. #  List only the subdirectories.
  89. alias app      (cat >>)    #  Append stdin to a file.
  90. alias loadhist source -n ~\history.csh
  91. alias dumphist (history -s >~\history.csh)
  92. alias w        ((wait;beep))  #  Wait for background processes and beep.
  93.  
  94. #  If you like, count the nesting level of this invocation of csh.exe
  95. #  and put it into the prompt of nested invocations.
  96. if ($?layer) then
  97.    @        layer++
  98.    set      prompt1 = '[$layer] $@ $CDISK% '
  99.    set      prompt2 = '[$layer] $@ $CDISK? '
  100. else
  101.    setenv   layer = 1
  102. end
  103.